Skip to content

Use LIBRARY_PATH to have ld look for libgccjit at link time #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2021

Conversation

dkm
Copy link

@dkm dkm commented May 30, 2021

LD_LIBRARY_PATH is used at runtime whereas LIBRARY_PATH is used during linking.
Without it, I get:

= note: /usr/bin/ld: cannot find -lgccjit
collect2: error: ld returned 1 exit status

during the cargo rustc in test.sh

LD_LIBRARY_PATH is used at runtime whereas LIBRARY_PATH is used during linking.
Without it, I get:

  = note: /usr/bin/ld: cannot find -lgccjit
          collect2: error: ld returned 1 exit status

during the `cargo rustc` in `test.sh`
@dkm
Copy link
Author

dkm commented May 30, 2021

I wonder why I do get this error? I'm using GNU ld for linking and my cc command points to gcc10. Maybe this behavior is different in your setup (maybe clang/lld are also using LD_LIBRARY_PATH during link?)

@dkm
Copy link
Author

dkm commented May 30, 2021

FYI, the log tail of the error.
log.txt

@antoyo
Copy link
Contributor

antoyo commented May 31, 2021

I'll try the setup in another computer to check this, but when I test libgccjit outside of rustc_codegen_gcc, I indeed needed to set LIBRARY_PATH, but I thought it was at runtime. I'll check that tomorrow!

@antoyo antoyo merged commit dd766df into rust-lang:master May 31, 2021
@antoyo
Copy link
Contributor

antoyo commented May 31, 2021

Oh, that was not needed in my case because I had installed libgccjit system-wide.

Thanks for noticing this!

@dkm
Copy link
Author

dkm commented May 31, 2021

Great ! Will continue with the integration with compiler explorer then!

@dkm dkm deleted the pr/fix_ld branch May 31, 2021 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants